ZgRNS Git Node
tests/run_tests.sh master (93ad7c85) Text, 2.24 KB
T8b949e#!/usr/bin/env bash
Tffa657set -e
Tffa657cd Ta5d6ff"Tff7b72$(dirname Ta5d6ff"Tffd700${Te6edf3BASH_SOURCETb4b4b4[0]Tffd700}Ta5d6ff"Tff7b72)Ta5d6ff"
rm -rf config node-config pages files node.log
Tffa657export Te6edf3PYTHONPATHTff7b72=Ta5d6ff"Tff7b72$(realpath ..Tff7b72)Ta5d6ff"
poetry run python3 Ta5d6ff<< 'EOF'
from pathlib import Path
from live_support import default_live_assets
pages, files, media = default_live_assets()
Path("pages").mkdir(parents=True, exist_ok=True)
Path("files").mkdir(parents=True, exist_ok=True)
Path("media").mkdir(parents=True, exist_ok=True)
for rel, content in pages.items():
path = Path("pages") / rel
path.parent.mkdir(parents=True, exist_ok=True)
if isinstance(content, bytes):
path.write_bytes(content)
else:
path.write_text(content, encoding="utf-8")
if rel.endswith(".mu") and str(content).startswith("#!"):
path.chmod(0o755)
for rel, content in files.items():
path = Path("files") / rel
path.parent.mkdir(parents=True, exist_ok=True)
if isinstance(content, bytes):
path.write_bytes(content)
else:
path.write_text(content, encoding="utf-8")
for rel, content in media.items():
path = Path("media") / rel
path.parent.mkdir(parents=True, exist_ok=True)
if isinstance(content, bytes):
path.write_bytes(content)
else:
path.write_text(content, encoding="utf-8")
EOF
mkdir -p config node-config
poetry run python3 -m rns_page_node.main Tffea00\
-c config Tffea00\
-i node-config Tffea00\
-p pages Tffea00\
-f files Tffea00\
-m media Tffea00\
--log-level ERROR Tffea00\
> node.log T79c0ff2>Tb4b4b4&T79c0ff1 Tb4b4b4&
Te6edf3NODE_PIDTff7b72=Te6edf3$!
Tffa657echo Ta5d6ff"Waiting for node identity..."
Tff7b72for _ Tff7b72in Tff7b72{T79c0ff1..40Tff7b72}Tb4b4b4; Tff7b72do
Tff7b72if Tff7b72[ -f node-config/identity Tff7b72]Tb4b4b4; Tff7b72then
Tffa657echo Ta5d6ff"Identity file found"
Tff7b72break
Tff7b72fi
sleep T79c0ff0.25
Tff7b72done
Tff7b72if Tff7b72[ ! -f node-config/identity Tff7b72]Tb4b4b4; Tff7b72then
Tffa657echo Ta5d6ff"Error: node identity file not found" >Tb4b4b4&T79c0ff2
cat node.log
Tffa657kill Ta5d6ff"Te6edf3$NODE_PIDTa5d6ff" Tff7b72|| Tffa657true
Tffa657exit T79c0ff1
Tff7b72fi
Tffa657echo Ta5d6ff"Running unit and advanced pytest..."
poetry run pytest Tffea00\
test_handlers_unit.py Tffea00\
test_config_unit.py Tffea00\
test_path_security.py Tffea00\
test_media_oracle.py Tffea00\
test_media_adversarial.py Tffea00\
test_media_stress.py Tffea00\
test_media_performance.py Tffea00\
test_advanced.py
Tffa657echo Ta5d6ff"Running live transport pytest..."
poetry run pytest test_live_transport.py
Tffa657echo Ta5d6ff"Running transport integration client script..."
poetry run python3 test_client.py
Tffa657kill Ta5d6ff"Te6edf3$NODE_PIDTa5d6ff" Tff7b72|| Tffa657true
Served by rngit 1.5.2 - Generated in 0.04s